package com.practice;

import java.util.Scanner;

public class AddPsd {
    public static void main(String[] args) {
        //数字加密   每位加5余10反转
        //1.得到数字
        Scanner sc=new Scanner(System.in);
        int psd=sc.nextInt();
        //2.根据规则编写方法
        int psd2=operate(psd);
        //3.输出加密的数字
        System.out.println(psd2);

    }
    public static int operate(int psd){
        int psd2=0;
        while (psd!=0){
            int temp=psd%10;
            psd2=(temp+5)%10+psd2*10;
            psd/=10;
        }
        return psd2;
    }
}


